import type { VNode } from "vue";

export interface SelectOption {
    label: string;
    value: string;
    disabled?: boolean;
}


export interface SelectProps {
    options?: SelectOption[],
    placeholder?: string,
    disabled?: boolean,
    clearable?: boolean,
    renderLabel?: RanderLabel,
    filterable?: boolean,
    filterMethod?: FilterMethod,
    remote?: boolean,
    remoteMethod?: RemoteMethod,
}

export type RanderLabel = (option: SelectOption) => VNode
export type FilterMethod = (label: string) => SelectOption[]
export type RemoteMethod = (label: string) => Promise<SelectOption[]>


export interface SelectEmits {
    (e: 'change', value: string): void;
    (e: 'visible-change', value: boolean): void;
    (e: 'clear'): void;
}